﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace N02
{

    public interface ISongWords
    {
        string GetSongWords();
    }

    // 底层模块依赖抽象
    public class ChineseSong: ISongWords
    {
        public string GetSongWords()
        {
            return "中文歌";
        }

    }
    // 底层模块
    public class EnglishSong: ISongWords
    {
        public string GetSongWords()
        {
            return "English";
        }
    }
    // 高层模块：依赖抽象；改为依赖接口
    public class Singer
    {
        public void SingSong(ISongWords songwords)
        {
            Console.WriteLine("唱" + songwords.GetSongWords());
        } 

    }



}
 